import React, {useEffect, useState} from "react";
import {
    Dimensions,
    RefreshControl,
    ScrollView,
    StyleSheet,
    Text,
    TextInput,
    TouchableHighlight,
    View
} from "react-native";
import {SvgXml} from 'react-native-svg';
import {
    addSvgXml,
    alignLeftSvgXml,
    checkSvgXml,
    closeeyeSvgXml,
    closeSvgXml,
    copySvgXml,
    downSvgXml,
    ethSvgXml,
    openeyeSvgXml,
    scanSvgXml,
    searchSvgXml,
    transferSvgXml,
    walletListSvgXml,
    walletSvgXml
} from "../libs/svgXml";
import {Tab} from "react-native-elements/dist/tab/Tab";
import {TabView} from "react-native-elements";
import {fontSize_12, fontSize_14, fontSize_15, fontSize_16, fontSize_25} from "./theme";
import {BottomSheet} from "react-native-elements/dist/bottomSheet/BottomSheet";
import {getBalanceWithProvider, getTokenBalance} from "./smartxL2Libs/smartxL2Web3";
import BigNumber from "bignumber.js";
import {
    getChainBaseByChainID,
    getChainInfo,
    getTokenByChainID,
    getTokenListByChainID,
    getWalletInfo,
    initNet,
    nowWallet,
    tokenNetType,
    updateNowWallet,
    updateTokenNet,
    updateWalletInfo
} from "./smartxL2Libs/L2_Data";
import {Avatar} from "react-native-elements/dist/avatar/Avatar";
import {BigMul} from "./smartxL2Libs/L2_utils";
import tokenLogo_Normal from './Asset/question.png'
import {useFocusEffect} from "@react-navigation/native";
import L2_NodeView from "./L2_NodeView";

const {width, height, scale} = Dimensions.get("window");
let refresh_HomeView = true;
const L2_HomeView = ({navigation}: any) => {
    const [address,setAddress] = useState("");
    const [netList,setNetList] = useState([]);
    const [Asset_Index, setAsset_Index] = useState(0);
    //主币数据
    const [AssetList, setAssetList] = useState([
        {logoImg: "",coinName:"", name: "",chainName:"",chainID:"", balance: "", valueOfCNY: "", valueOfUSDT: "",viewWallet:false,},
    ]);
    //代币数据
    const [tokenList,setTokenList]:tokenNetType[]|any= useState([])
    const [walletList,setWalletList] = useState([{address:"",balance:"",viewWallet:false,walletName:"",chainID:"",coinName:""}]);
    const [tipText,setTipText] = useState("")
    const [NFTContractsList, setNFTContractsList] = useState([]);
    const [showCNY,setShowCNY] = useState(true)
    //钱包列表--多链与多钱包
    const [WalletViewVisible,setWalletViewVisible] = useState(false);
    //刷新页面
    const [refresh,setRefresh] = useState(true)
    //显示创建钱包或者导入钱包
    const [moreWalletVisible,setMoreWalletVisible] = useState(false)
    //钱包列表的链的选中
    const [selectedChainInfo,setSelectedChainInfo]:any = useState()

    useEffect(() => {
        console.log(`refresh:${refresh}`)
        if(!refresh_HomeView)
        {
            return;
        }
        refresh_HomeView = false
        worker()
        initTokenList()
        updateTokenListBalance()
    },[refresh])
    //重新聚焦在这个界面
    useFocusEffect(
        React.useCallback(() => {
            worker()
            initTokenList()
            updateTokenListBalance()
        },[])
    );
    const worker = async () => {
        let netList = await initNet();
        console.log(netList)
        setNetList(netList)
        let addressTemp = nowWallet.address;
        console.log(`nowWallet`)
        console.log(nowWallet)
        console.log(`addressTemp=${addressTemp}`)
        setAddress(addressTemp);
        let nowWalletDetail = await getWalletInfo(nowWallet.chainID,nowWallet.address)
        let addressBalance = nowWalletDetail.balance;
        let valueOfCNY = (new BigNumber(addressBalance)).multipliedBy(0.0026)
        let net = await getChainBaseByChainID(nowWallet.chainID);
        console.log(nowWalletDetail.privateKey !== "")
        console.log(nowWalletDetail)
        let AssetList = [{logoImg: net?.img,chainName:net?.name || "",chainID:nowWallet.chainID,viewWallet:nowWalletDetail.privateKey === "",coinName:net?.coinName || "", name: nowWalletDetail.walletName, balance: new BigNumber(addressBalance).dp(4,1).toString(), valueOfCNY:valueOfCNY.dp(4).toString(), valueOfUSDT: "0"}];
        console.log(AssetList[0].logoImg,typeof AssetList[0].logoImg)
        setAssetList(AssetList);
        if(net)
        {
            setSelectedChainInfo(net)
        }
        setTipText(net?.tipText || net?.name)
        await getWalletList(nowWallet.chainID)
    }
    const initTokenList = async () => {
        let res = await getTokenListByChainID(nowWallet.chainID,nowWallet.address);
        let tokenListTemp:tokenNetType[] = [];
        for(let i = 0 ; i < res.tokenAddressList.length ; i++)
        {
            let tokenTemp:tokenNetType|null;
            tokenTemp = await getTokenByChainID(nowWallet.chainID,res.tokenAddressList[i],nowWallet.address);
            if(tokenTemp)
            {
                tokenListTemp.push(tokenTemp);
            }
        }
        setTokenList(tokenListTemp);
    }
    const updateTokenListBalance = async () => {
        let tokenListNet = await getTokenListByChainID(nowWallet.chainID,nowWallet.address);
        let List = tokenListNet.tokenAddressList;
        let tokenListTemp:tokenNetType[] = [];
        for(let i = 0; i < List.length ; i++)
        {
            let balance = await getTokenBalance(List[i]);
            console.log(`updateTokenListBalance:${balance}`)
            let tokenTemp = await getTokenByChainID(nowWallet.chainID,List[i],nowWallet.address);
            if(tokenTemp && balance.success)
            {
                tokenTemp.balance = balance.data.balance;
                await updateTokenNet(nowWallet.chainID,tokenTemp,nowWallet.address)
            }
            if(tokenTemp)
            {
                tokenListTemp.push(tokenTemp);
            }
        }
        setTokenList(tokenListTemp);
    }
    const getWalletList = async (chainID: string) => {
        let chainBaseInfo = await getChainBaseByChainID(chainID);
        let walletListNet = await getChainInfo(chainID);
        console.log(`getWalletList`,walletListNet)
        let walletListTemp = [];
        for (let i = 0; i < walletListNet.walletList.length; i++) {
            let nowWalletDetail = await getWalletInfo(chainID,walletListNet.walletList[i])
            let addressBalanceTemp = nowWalletDetail.balance ;
            walletListTemp.push({
                chainID:chainID,
                balance: new BigNumber(addressBalanceTemp).dp(4, 1).toString(),
                address: walletListNet.walletList[i],
                viewWallet: nowWalletDetail.privateKey === "",
                walletName: nowWalletDetail.walletName,
                coinName:chainBaseInfo?.coinName,
            });
        }
        console.log(`walletListTemp`,walletListTemp)
        setWalletList(walletListTemp);
        for (let i = 0; i < walletListTemp.length; i++) {
            let nowWalletDetail = await getWalletInfo(chainID,walletListTemp[i].address)
            let addressBalanceTemp = await getBalanceWithProvider(walletListTemp[i].address,walletListNet.selectedProviderUrl);
            walletListTemp[i].balance = new BigNumber(addressBalanceTemp).dp(4, 1).toFixed();
            nowWalletDetail.balance = walletListTemp[i].balance;
            await updateWalletInfo(nowWalletDetail)
        }
    }


    return (
        <View style={styles.container}>
            <View style={styles.header}>
                <SvgXml xml={alignLeftSvgXml} width={25} height={25} onPress={()=>{
                    // console.log(WalletViewVisible+"111")
                    setWalletViewVisible(!WalletViewVisible)
                }}/>
                <TouchableHighlight underlayColor={"transparent"} onPress={()=>{
                    navigation.navigate("L2_NodeView")
                }}>
                    <View style={styles.dot_green}/>
                </TouchableHighlight>
                <View style={{flex: 1}}/>
                <SvgXml xml={walletSvgXml} width={28} height={28} onPress={async ()=>{
                    navigation.navigate("L2_AddNet")
                }}/>
                <SvgXml xml={scanSvgXml()} width={25} height={25} style={{marginLeft: 15}}/>
            </View>
            <ScrollView style={{width: "100%"}}
                        fadingEdgeLength={20}
                        showsVerticalScrollIndicator={false}
                        nestedScrollEnabled={true}
                        refreshControl={
                            <RefreshControl refreshing={false} onRefresh={() => {
                                console.log(`RefreshControl:${refresh}`)
                                refresh_HomeView = true;
                                setRefresh(!refresh)
                            }} collapsable={true}/>
                        }
            >
                <View style={styles.scrollContainer}>
                    <View style={styles.Asset_all}>
                        <TouchableHighlight underlayColor={"transparent"} onPress={()=>{

                            navigation.navigate("L2_WalletDetail",{
                                providerUrl:nowWallet.providerUrl,
                                address:nowWallet.address,
                                name:AssetList[0].name,
                                img:AssetList[0].logoImg,
                                viewWallet:AssetList[0].viewWallet
                            })
                        }}>
                            <View style={styles.Asset_all_View}>
                            <View style={styles.Asset_all_First}>
                                <View style={{flexDirection: "row", alignItems: "center"}}>
                                    <Text style={styles.Asset_all_First_title}>
                                        {AssetList[0].name}
                                    </Text>
                                    {
                                        showCNY?
                                            <SvgXml style={{marginLeft: 8}} onPress={() => {
                                                setShowCNY(false)
                                                }} xml={openeyeSvgXml("#edf4fc")} width={15} height={15}/>
                                            :
                                            <SvgXml style={{marginLeft: 8}} onPress={() => {
                                                setShowCNY(true)
                                                }} xml={closeeyeSvgXml("#edf4fc")} width={15} height={15}/>
                                    }
                                </View>
                                <Text style={styles.Asset_all_First_detail}>
                                    详情 >
                                </Text>
                            </View>
                            <View style={styles.Asset_all_Second}>
                                <Text style={{fontSize: fontSize_14, color: "white"}}>{showCNY?"¥":""} <Text
                                    style={{fontSize: fontSize_25, color: "white", fontWeight: "bold"}}>{showCNY?AssetList[0].valueOfCNY:"***"}</Text></Text>
                                <SvgXml xml={ethSvgXml} width={50} height={50} style={{marginLeft: 15}}/>
                            </View>
                        </View>
                        </TouchableHighlight>
                        <View style={styles.Asset_change}>
                            <TouchableHighlight
                                underlayColor={"white"}
                                onPress={() => {
                                    console.log('转账')
                                    navigation.navigate("L2_Send_Way");
                                }}
                                style={{flex: 1}}
                            >
                                <View style={{
                                    alignItems: "center",
                                    justifyContent: "center",
                                    flex: 1,
                                    flexDirection: "row"
                                }}>
                                    <SvgXml xml={transferSvgXml} width={25} height={25} style={{marginRight: 15}}/>
                                    <Text style={{textAlignVertical: "center",fontSize:fontSize_15}}>
                                        转账
                                    </Text>
                                </View>
                            </TouchableHighlight>
                            <View style={{height: 20, width: 1, backgroundColor: "#f5f5f5"}}/>
                            <TouchableHighlight
                                underlayColor={"white"}
                                onPress={() => {
                                    navigation.navigate("L2_Receive",{address:address,tipText});
                                    console.log(`收款`)
                                }}
                                style={{flex: 1}}
                            >
                                <View style={{
                                    alignItems: "center",
                                    justifyContent: "center",
                                    flex: 1,
                                    flexDirection: "row"
                                }}>
                                    <SvgXml xml={downSvgXml} width={25} height={25} style={{marginRight: 15}}/>
                                    <Text>
                                        收款
                                    </Text>
                                </View>
                            </TouchableHighlight>
                        </View>
                    </View>
                    <View style={styles.Asset_NFT}>
                        <View style={styles.Asset_NFT_header}>
                            <View style={styles.tabStyle}>
                                <Tab value={Asset_Index} variant={'default'} onChange={(i) => setAsset_Index(i)}
                                     disableIndicator={false}
                                     indicatorStyle={styles.tabIndicatorStyle}
                                >
                                    <Tab.Item title={"资产"}
                                              background={null}
                                              buttonStyle={{padding: 0, margin: 0}}
                                              containerStyle={{backgroundColor: "white"}}
                                              titleProps={{
                                                  style: {
                                                      padding: 0,
                                                      marginLeft: -25,
                                                      color: "black",
                                                      fontSize: fontSize_16,
                                                      lineHeight: 31
                                                  }
                                              }}
                                    />
                                    <Tab.Item title="NFT"
                                              background={null}
                                              buttonStyle={{padding: 0, margin: 0,}}
                                              containerStyle={{backgroundColor: "white"}}
                                              titleProps={{
                                                  style: {
                                                      padding: 0,
                                                      marginLeft: -25,
                                                      color: "black",
                                                      fontSize: fontSize_16,
                                                      lineHeight: 31
                                                  }
                                              }}
                                    />
                                </Tab>
                            </View>
                            <View style={styles.addAsset_NFT}>
                                <TextInput style={styles.addAsset_NFT_search}
                                           placeholder={"搜索"}
                                />
                                <SvgXml xml={searchSvgXml} width={20} height={20}
                                        style={{position: "absolute", left: 2, top: 0}}/>
                                {/**/}
                                {/*<Text style={{fontSize:fontSize_16,color:"#dfe0e2"}}>搜索</Text>*/}
                                <SvgXml xml={addSvgXml("#343537")} width={20} height={20}
                                        style={{backgroundColor: "#f5f6f8", borderRadius: 14}}
                                        onPress={()=>{
                                            navigation.navigate("L2_GetToken",{chainID:nowWallet.chainID})
                                        }}
                                />
                            </View>
                        </View>
                        <TabView value={Asset_Index}>
                            <TabView.Item style={{flex: 1}}>
                                <View style={styles.AssetContainer}>
                                    {
                                        AssetList.length > 0 ?
                                            AssetList.map((item, index: number) => (
                                                <TouchableHighlight underlayColor={"transparent"} onPress={()=>{
                                                    navigation.navigate("L2_TxList",{
                                                        img:item.logoImg,
                                                        name:item.coinName,
                                                    })
                                                }} key={"AssetList_"+index}>
                                                    <View style={styles.assetItemContainer} key={index+"_AssetList"}>
                                                        <View style={{flexDirection: "row", alignItems: "center"}}>
                                                            <Avatar source={((typeof item.logoImg)==="number")?item.logoImg:{uri:item.logoImg}} rounded={true} activeOpacity={0.7}
                                                                    containerStyle={{borderWidth: 0 / scale}}/>
                                                        </View>
                                                        <Text style={{fontSize: fontSize_16, marginLeft: 10}}>{item.coinName}</Text>
                                                        <View style={{flex: 1}}/>
                                                        <View style={{flexDirection: "column", alignItems: "flex-end"}}>
                                                            <Text style={{fontSize: fontSize_16}}>{item.balance}</Text>
                                                            <Text style={{
                                                                fontSize: fontSize_12,
                                                                color: "#868686"
                                                            }}>¥ {item.valueOfCNY}</Text>
                                                        </View>
                                                    </View>
                                                </TouchableHighlight>
                                            ))
                                            :
                                            null
                                    }
                                    {
                                        tokenList.length > 0 ?
                                            tokenList.map((item:tokenNetType, index: number) => (
                                                <TouchableHighlight underlayColor={"transparent"} onPress={()=>{
                                                    navigation.navigate("L2_TxList",{
                                                        img:item.tokenImg?item.tokenImg:tokenLogo_Normal,
                                                        name:item.tokenSymbloName,
                                                        tokenAddress:item.tokenAddress
                                                    })
                                                }} key={"AssetList_"+index}>
                                                    <View style={styles.assetItemContainer} key={index+"_AssetList"}>
                                                        <View style={{flexDirection: "row", alignItems: "center"}}>
                                                            <Avatar source={item.tokenImg?{uri:item.tokenImg}:tokenLogo_Normal} rounded={true} activeOpacity={0.7}
                                                                    containerStyle={{borderWidth: 0 / scale}}/>
                                                        </View>
                                                        <Text style={{fontSize: fontSize_16, marginLeft: 10}}>{item.tokenSymbloName}</Text>
                                                        <View style={{flex: 1}}/>
                                                        <View style={{flexDirection: "column", alignItems: "flex-end"}}>
                                                            <Text style={{fontSize: fontSize_16}}>{new BigNumber(item.balance).toFixed(4)}</Text>
                                                            <Text style={{
                                                                fontSize: fontSize_12,
                                                                color: "#868686"
                                                            }}>¥ {BigMul(item.tokenPrice_CNY,item.balance)}</Text>
                                                        </View>
                                                    </View>
                                                </TouchableHighlight>
                                            ))
                                            :
                                            null
                                    }
                                </View>
                            </TabView.Item>
                            <TabView.Item style={{flex: 1}}>
                                <View style={styles.NFTContainer}>
                                </View>
                            </TabView.Item>
                        </TabView>
                    </View>
                </View>
            </ScrollView>
            <BottomSheet
                modalProps={{animationType:"fade"}}
                isVisible={WalletViewVisible}
                containerStyle={{ backgroundColor: 'rgba(0.5, 0.25, 0, 0.2)' }}
            >
                <View style={styles.WalletViewContainer}>
                    <TouchableHighlight underlayColor={"transparent"} onPress={()=>{
                        // console.log(WalletViewVisible+"222")
                        setWalletViewVisible(!WalletViewVisible)
                    }}>
                        <View style={styles.headerContainer}>
                            <SvgXml xml={walletListSvgXml} width={28} height={28} onPress={()=>{
                                console.log("3333")
                            }}/>
                            <Text>钱包列表</Text>
                            <SvgXml xml={closeSvgXml()} width={20} height={20} />
                        </View>
                    </TouchableHighlight>
                    <View style={styles.WalletViewMainContainer}>
                        <View style={styles.netContainer}>
                            {
                                netList.length?
                                    netList.map((item:any,index)=>(
                                        <TouchableHighlight underlayColor={"transparent"}
                                                            style={item.chainID === (selectedChainInfo && selectedChainInfo.chainID)?styles.netItemSelected:styles.netItem}
                                                            onPress={()=>{
                                                                console.log(item)
                                                                setSelectedChainInfo(item)
                                                                getWalletList(item.chainID)



                                                            }} key={`netList_`+index} >
                                            <View style={{flex:1,alignItems:"center",justifyContent:"center"}}  key={"netList_"+index}>
                                                <Avatar source={((typeof item.img)==="number")?item.img:{uri:item.img}} rounded={true} activeOpacity={0.7}
                                                        containerStyle={{borderWidth: 0 / scale}}/>
                                            </View>
                                        </TouchableHighlight>
                                    )):null
                            }

                        </View>
                        <View style={styles.walletContainer}>
                            <View style={styles.walletHeader}>
                                <Text style={{fontWeight:"bold",fontSize:fontSize_16}}>
                                    {selectedChainInfo && selectedChainInfo.name}
                                </Text>
                                {
                                    walletList.length ?
                                        <SvgXml xml={addSvgXml("#343537")} width={20} height={20}
                                                style={{backgroundColor: "#f5f6f8", borderRadius: 14}} onPress={() => {
                                            setWalletViewVisible(false)
                                            setMoreWalletVisible(true)
                                            // navigation.navigate("L2_ImportWay",{providerUrl:nowWallet.providerUrl})
                                        }}/> : null
                                }
                            </View>
                            <ScrollView showsVerticalScrollIndicator={false}>
                            {
                                walletList.length?
                                    walletList.map((item,index:number)=>(
                                        <TouchableHighlight
                                            underlayColor={"transparent"}
                                            key={"walletList_"+index}
                                            onPress={async () => {
                                                let chainInfo = await getChainInfo(selectedChainInfo.chainID)
                                                await updateNowWallet({
                                                    chainID:item.chainID,
                                                    address: item.address,
                                                    providerUrl: chainInfo.selectedProviderUrl
                                                })
                                                refresh_HomeView = true;
                                                setRefresh(!refresh)
                                                setWalletViewVisible(false)
                                            }}>
                                            <View style={{flexDirection:"column",backgroundColor:"#000000",borderRadius:5,marginBottom:20}}>
                                                <View style={{flexDirection:"row",padding:10,paddingBottom:5,alignItems:"center"}}>
                                                    <Text style={{color:"#dda919",fontSize:fontSize_16}}>{item.walletName}</Text>
                                                    {
                                                        item.viewWallet?
                                                            <Text style={{borderWidth:1/scale,marginLeft:10,color:"#dda919",borderColor:"#dda919",padding:5,fontSize:fontSize_12,paddingTop:2,paddingBottom:2}}>观察钱包</Text>
                                                            :
                                                            null
                                                    }
                                                </View>
                                                <View style={{flexDirection:"row",padding:10,paddingTop:0,paddingBottom:5,alignItems:"center"}}>
                                                    <Text style={{fontSize:fontSize_14,color:"#937019"}}>{item.address.slice(0,6)}...{item.address.slice(-6)}</Text>
                                                    <SvgXml xml={copySvgXml} width={14} height={14} color={'#937019'} style={{marginLeft:10}}/>
                                                </View>
                                                <View style={{flexDirection:"row",justifyContent:"flex-end",padding:10,paddingTop:0}}>
                                                    <Text style={{fontSize:fontSize_16,color:"white"}}>{item.balance} {item.coinName}</Text>
                                                </View>
                                                {
                                                    nowWallet.address===item.address && item.chainID === nowWallet.chainID?
                                                        <SvgXml xml={checkSvgXml("#dda919")} width={25} height={25} style={{position:"absolute",right:10,bottom:36}}/>
                                                        :null
                                                }
                                            </View>
                                        </TouchableHighlight>
                                    )):

                                    <TouchableHighlight underlayColor={"transparent"} style={styles.dashBTN} onPress={()=>{
                                        setWalletViewVisible(false)
                                        setMoreWalletVisible(true)}
                                    }>
                                        <Text style={styles.dashBTNTitle}>添加钱包</Text>
                                    </TouchableHighlight>
                            }
                            </ScrollView>
                        </View>
                    </View>
                </View>
            </BottomSheet>
            <BottomSheet
                modalProps={{animationType:"fade"}}
                isVisible={moreWalletVisible}
            >
                <View style={{width:width,height:height-1,backgroundColor: 'rgba(0.5, 0.25, 0, 0.2)'}}>
                    <TouchableHighlight underlayColor={"transparent"} style={{flex:1}} onPress={()=>{
                        setMoreWalletVisible(false)
                    }}>
                        <View/>
                    </TouchableHighlight>
                    <TouchableHighlight underlayColor={"white"} style={[styles.bottomSheetItem,styles.bottomSheetItemFirst]} onPress={async () => {
                        setMoreWalletVisible(false)
                        let chainInfo = await getChainInfo(selectedChainInfo.chainID)
                        navigation.navigate("L2_CreateWalletWay", {
                            chainID: selectedChainInfo.chainID,
                            providerUrl: chainInfo.selectedProviderUrl
                        })
                    }}>
                        <Text style={[styles.bottomSheetItemTitle]}>创建钱包</Text>
                    </TouchableHighlight>
                    <TouchableHighlight underlayColor={"white"} style={[styles.bottomSheetItem]} onPress={async () => {
                        setMoreWalletVisible(false)
                        let chainInfo = await getChainInfo(selectedChainInfo.chainID)
                        navigation.navigate("L2_ImportWay", {
                            providerUrl: chainInfo.selectedProviderUrl,
                            chainID: selectedChainInfo.chainID
                        })
                    }}>
                        <Text style={[styles.bottomSheetItemTitle]}>导入钱包</Text>
                    </TouchableHighlight>
                    <View style={styles.divider_10}/>
                    <TouchableHighlight underlayColor={"white"} style={[styles.bottomSheetItem]} onPress={()=>{
                        setMoreWalletVisible(false)
                    }}>
                        <Text style={[styles.bottomSheetItemTitle]}>取消</Text>
                    </TouchableHighlight>

                </View>
            </BottomSheet>

        </View>
    )
}
const styles = StyleSheet.create({
    container: {
        flex: 1,
        width:width,
        alignItems: "center",
        flexDirection: "column",
        paddingLeft: 10,
        paddingRight: 10,
    },
    WalletViewContainer:{
        width:width,
        height:height*3/4,
        backgroundColor:"white",
        borderTopRightRadius:10,
        borderTopLeftRadius:10
    },
    header: {
        width: "100%",
        height: 40,
        flexDirection: "row",
        alignItems: "center"
    },
    dot_green: {
        width: 10,
        height: 10,
        borderRadius: 5,
        backgroundColor: "green",
        marginLeft: 15
    },
    dot_red: {
        width: 10,
        height: 10,
        borderRadius: 5,
        backgroundColor: "red",
        marginLeft: 15
    },
    dot_yellow: {
        width: 10,
        height: 10,
        borderRadius: 5,
        backgroundColor: "yellow",
        marginLeft: 15
    },
    headerContainer:{
        width:"100%",
        backgroundColor:"white",
        height:45,
        flexDirection:"row",
        alignItems:"center",
        justifyContent:"space-between",
        padding:10,
        borderTopRightRadius:10,
        borderTopLeftRadius:10,
        borderBottomWidth:1/scale
    },

    scrollContainer: {
        width: "100%",
        minHeight: height + 150
    },
    Asset_all: {
        width: "100%",
        // height:100,
        backgroundColor: "white",
        borderRadius: 5,
        flexDirection: "column",
        marginTop: 10,
        elevation: 2,
    },
    Asset_NFT: {
        width: "100%",
        backgroundColor: "white",
        marginTop: 20,
        minHeight: 500
    },
    Asset_all_View: {
        backgroundColor: "#1f83fd",
        padding: 17,
        borderRadius: 5
    },
    Asset_change: {
        width: "100%",
        height: 50,
        flexDirection: "row",
        backgroundColor: "white",
        alignItems: "center"
    },

    Asset_NFT_header: {
        width: "100%",
        flexDirection: "row",
        alignItems: "center",
        justifyContent: "space-between",
        backgroundColor: "white",
        height: 50,
    },
    AssetContainer: {
        width: "100%",
        flex: 1,
        backgroundColor: "white"
    },
    NFTContainer: {
        width: "100%",
        flex: 1,
        backgroundColor: "blue"
    },

    tabStyle: {
        width: 120,
        alignItems: "flex-start"
    },
    addAsset_NFT: {
        flexDirection: "row",
    },

    Asset_all_First: {
        flexDirection: "row",
        justifyContent: "space-between",
        alignItems: "center",
    },
    Asset_all_Second: {
        flexDirection: "row",
        justifyContent: "space-between",
        marginTop: 10,
        alignItems: "center"
    },

    Asset_all_First_title: {
        fontSize: fontSize_15,
        color: "#edf4fc",
    },
    Asset_all_First_detail: {
        fontSize: fontSize_12,
        color: "#b5dff6",
    },

    tabIndicatorStyle: {
        height: 2,
        backgroundColor: "black",
        width: 20,
        left: 8
    },
    addAsset_NFT_search: {
        width: 100,
        height: 22,
        backgroundColor: "#f5f6f8",
        fontSize: fontSize_12,
        flexDirection: "row",
        alignItems: "center",
        padding: 0,
        borderRadius: 14,
        paddingRight: 14,
        paddingLeft: 30,
        marginRight: 10,
    },
    assetItemContainer: {
        width: width - 20,
        paddingTop: 15,
        backgroundColor: "white",
        paddingBottom: 15,
        flexDirection: "row",
        alignItems: "center",
        justifyContent: "flex-start"
    },

    WalletViewMainContainer:{
        flex:1,
        backgroundColor:"white",
        flexDirection:"row"
    },
    walletContainer:{
        flex:1,
        flexDirection:"column",
        paddingLeft:10,
        paddingRight:10
    },

    walletHeader:{
        flexDirection:"row",
        alignItems:"center",
        justifyContent:"space-between",
        height:50,
    },
    netContainer:{
        width:60,
        backgroundColor:"#f5f6f8",
        alignItems:"center"
    },
    netItem:{
        width:"100%",
        height:58,
        justifyContent:"center",
        alignItems:"center"
    },
    netItemSelected:{
        width:"100%",
        height:58,
        backgroundColor:"white",
        justifyContent:"center",
        alignItems:"center"
    },
    netItemBG:{
        width:36,
        height:36,
        borderRadius:18,
        backgroundColor:"#e9e9ee",
        justifyContent:"center",
        alignItems:"center"
    },
    netItemBGSelected:{
        width:36,
        height:36,
        borderRadius:18,
        backgroundColor:"#e9e9ee",
        justifyContent:"center",
        alignItems:"center"
    },
    divider_10:{
        width:width,
        height:5,
        backgroundColor:"#f6f6f6",
        alignItems:"center",
        flexDirection:"row"
    },
    bottomSheetItem:{
        width:width,
        height:50,
        backgroundColor:"white",
        borderBottomWidth:2,
        borderBottomColor:"#f6f6f6",
        alignItems:"center",
        justifyContent:"center"
    },
    bottomSheetItemFirst:{
        borderTopRightRadius:10,
        borderTopLeftRadius:10
    },
    bottomSheetItemTitle:{
        fontSize:fontSize_15,
        color:"#2e81d9"
    },
    dashBTN:{
        borderStyle: 'dashed',
        borderColor:'#e2e2e2',
        borderWidth:1,
        borderRadius: 1,
        width:"100%",
        height:70,
        alignItems:"center",
        justifyContent:"center"
    },
    dashBTNTitle:{
        fontSize:fontSize_15,
        color:"#a0a0a0"
    }
})

export default L2_HomeView;


